 |
 |
 |
 |
#263954 - 08/08/04 03:47 PM
Re: Beta-[6.5] Photopost Information in Post Screens 2.0
[Re: Luka_dup1]
|
Old Hand
Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
|
hmm that part is already there... so maybe it fails in the part I told ya to add?<br /><br /> 2.1 Find:<br />// -----------------------------------------------------------------<br />// We need to know how many posts of this thread to display per page<br /> if ($fpart <= 1) {<br /> $Totalgrab = $Totaldisplay;<br /> }<br /> else {<br /> $Startat = $Totaldisplay * ($fpart - 1);<br /> $Totalgrab = "$Startat, $Totaldisplay";<br /> }<br /> $Limit = "LIMIT $Totalgrab";<br /> if ($fpart == "all") {<br /> $Limit = "";<br /> }<br /><br /> $threadnumber = $Number;<br /><br />2.2 BELOW it ADD:<br />// Photopost Information Post Screens 1.0 - New Start<br /> $query = "<br /> SELECT B_PosterId<br /> FROM {$config['tbprefix']}Posts<br /> WHERE B_Main = $current<br /> $Viewable<br /> GROUP BY B_PosterId<br /> ";<br /> <br /> $sth = $dbh -> do_query($query);<br /> $arrPosters = array();<br /> $strFilter = "";<br /> <br /> // Put all the unique ID's of the posters for this page in an array<br /> // and construct the filter for the Photopost database<br /> while (list($intPosterId) = $dbh->fetch_array($sth)) {<br /> $arrPosters["$intPosterId"] = 0;<br /> $strFilter .= "$intPosterId,";<br /> }<br /> <br /> // Now strip the last comma from the filter variable<br /> $strFilter = substr($strFilter, 0, -1);<br /> <br /> $PPLink = mysql_connect("{$config['PPost_Host']}:3306", "{$config['PPost_User']}", "{$config['PPost_Password']}", true) or <br /> die("Could not connect to PhotoPost host". mysql_error());<br /> <br /> mysql_select_db ("{$config['PPost_Database']}", $PPLink) or <br /> die ("Could not connect to PhotoPost database". mysql_error());<br /> <br /> $query = "SELECT userid, COUNT(id) <br /> FROM {$config['PPost_DBPrefix']}photos <br /> WHERE userid IN ($strFilter)<br /> GROUP BY userid ";<br /> <br /> // Do the query now<br /> $PPResult = mysql_query($query, $PPLink);<br /> <br /> // Now loop through the records and update the array<br /> while (list($intUser, $intCount) = mysql_fetch_array($PPResult)) {<br /> $arrPosters["$intUser"] = $intCount;<br /> }<br /> <br /> mysql_free_result($PPResult); <br />// Photopost Information Post Screens 1.0 - New End<br /> <br /><br />Just rechecked it's exactly what I have.. did you make sure you included the photopost database? did you create a file called configextras?
_________________________
Couchtomatoe - www.couch-tomatoe.ccMy abilities are for hire for installs, upgrades, custom themes and custom modifications.
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|